import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

TabBar buildTabBar(List<Widget> tabs,
    {labelColor: Colors.white, unselectedLabelColor: Colors.white}) {
  return TabBar(
    indicatorColor: Colors.white,
    indicatorSize: TabBarIndicatorSize.label,
    indicatorWeight: setRatio(3),
    labelColor: labelColor,
    unselectedLabelColor: unselectedLabelColor,
//                isScrollable: true,
    labelPadding: EdgeInsets.only(right: setRatio(1)),
    //解决最右侧文字有轻微遮住
//                indicatorPadding: EdgeInsets.only(left: setRatio(40)),
    labelStyle: TextStyle(
        color: labelColor,
        fontSize: setTextSp(15),
        fontFamily: FontFamily.PINGFANG,
        fontWeight: FontWeightCustom.PF_Medium),
    unselectedLabelStyle: TextStyle(
        color: unselectedLabelColor,
        fontSize: setTextSp(15),
        fontFamily: FontFamily.PINGFANG,
        fontWeight: FontWeightCustom.PF_Medium),
    indicator: UnderlineTabIndicator(
        borderSide: BorderSide(
            width: setRatio(3), color: Colors.white, style: BorderStyle.solid),
        insets: EdgeInsets.only(bottom: setRatio(10))),
    tabs: tabs,
  );
}
